<?php

/* Get field names from table and (if $edit_selected is set) get the record 
    values where first column equals the value in edit_selected for
    editing purposes */

$result = mysql_query("SELECT * FROM $tableName");
$fields = mysql_num_fields($result);
if ($edit_selected!='') {
        $result = mysql_query("SELECT * FROM $tableName WHERE " . 
		mysql_field_name($result, 0) . "='" . $edit_selected . "'");
	$plain = mysql_fetch_array($result);
}

?>
